package com.yc.bdw.Activity;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.yc.bdw.R;

import org.kymjs.kjframe.KJActivity;
import org.kymjs.kjframe.ui.BindView;


public class HomeActivity extends KJActivity{
    @BindView(id=R.id.home_akeyofwine_btn,click = true)
    private ImageView home_akeyofwine_btn;
    @BindView(id=R.id.home_liqueur_btn,click = true)
    private ImageView home_liqueur_btn;
    @BindView(id=R.id.home_wine_btn,click = true)
    private ImageView home_wine_btn;
    @BindView(id=R.id.home_foreignwine_btn,click = true)
    private ImageView  home_foreignwine_btn;

    @BindView(id=R.id.btn_home,click = true)
    private ImageView  btn_home;
    @BindView(id=R.id.btn_sort,click = true)
    private ImageView  btn_sort;
    @BindView(id=R.id.btn_shoppingcart,click = true)
    private ImageView  btn_shoppingcart;
    @BindView(id=R.id.btn_myself,click = true)
    private ImageView  btn_myself;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public void setRootView() {
        setContentView(R.layout.activity_home);
    }

    @Override
    public void widgetClick(View v) {
        super.widgetClick(v);
        super.widgetClick(v);
        switch (v.getId()) {
            case R.id.home_akeyofwine_btn:
                break;
            case R.id.home_liqueur_btn:
                showActivity(aty,SortListActivity.class);
                break;
            case R.id.home_wine_btn:
                showActivity(aty,SortListActivity.class);
                break;
            case R.id.home_foreignwine_btn:
                showActivity(aty,SortListActivity.class);
                break;
           //导航栏
            case R.id.btn_home:
                Changebackground();
                btn_home.setBackgroundResource(R.drawable.btn_home_pre);
                break;
            case R.id.btn_sort:
                Changebackground();
                btn_home.setBackgroundResource(R.drawable.btn_classify_pre);
                break;
            case R.id.btn_shoppingcart:
                Changebackground();
                btn_home.setBackgroundResource(R.drawable.btn_shopping_pre);
                break;
            case R.id.btn_myself:
                Changebackground();
                btn_home.setBackgroundResource(R.drawable.btn_my_pre);
                break;
        }
    }
    public void Changebackground(){
        btn_sort.setBackgroundResource(R.drawable.btn_classify_normal);
        btn_home.setBackgroundResource(R.drawable.btn_home_normal);
        btn_shoppingcart.setBackgroundResource(R.drawable.btn_shipped_normal);
        btn_myself.setBackgroundResource(R.drawable.btn_more_normal);
    }
}
